package com.blog.system.api.factory;

import com.blog.system.api.feign.RemoteAddressService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * <p>
 * ip地址服务降级处理
 * </p>
 *
 * @author Vivian
 * @date 2023/7/2
 **/
@Component
@Slf4j
public class RemoteAddressFallbackFactory implements FallbackFactory<RemoteAddressService> {
    @Override
    public RemoteAddressService create(Throwable cause) {
        log.error("ip服务调用失败:{}", cause.getMessage());
        return (ip, flag) -> null;
    }
}
